/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "socio_dependente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SocioDependente.findAll", query = "SELECT s FROM SocioDependente s")})
public class SocioDependente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(length = 100)
    private String nome;
    @Column(name = "DATA_NASCIMENTO")
    @Temporal(TemporalType.DATE)
    private Date dataNascimento;
    @Column(name = "DATA_INICIO_DEPEDENCIA")
    @Temporal(TemporalType.DATE)
    private Date dataInicioDepedencia;
    @Column(name = "DATA_FIM_DEPENDENCIA")
    @Temporal(TemporalType.DATE)
    private Date dataFimDependencia;
    @Column(length = 11)
    private String cpf;
    @JoinColumn(name = "ID_SOCIO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private Socio idSocio;
    @JoinColumn(name = "ID_TIPO_RELACIONAMENTO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private TipoRelacionamento idTipoRelacionamento;

    public SocioDependente() {
    }

    public SocioDependente(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Date getDataNascimento() {
        return dataNascimento;
    }

    public void setDataNascimento(Date dataNascimento) {
        this.dataNascimento = dataNascimento;
    }

    public Date getDataInicioDepedencia() {
        return dataInicioDepedencia;
    }

    public void setDataInicioDepedencia(Date dataInicioDepedencia) {
        this.dataInicioDepedencia = dataInicioDepedencia;
    }

    public Date getDataFimDependencia() {
        return dataFimDependencia;
    }

    public void setDataFimDependencia(Date dataFimDependencia) {
        this.dataFimDependencia = dataFimDependencia;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = cpf;
    }

    public Socio getIdSocio() {
        return idSocio;
    }

    public void setIdSocio(Socio idSocio) {
        this.idSocio = idSocio;
    }

    public TipoRelacionamento getIdTipoRelacionamento() {
        return idTipoRelacionamento;
    }

    public void setIdTipoRelacionamento(TipoRelacionamento idTipoRelacionamento) {
        this.idTipoRelacionamento = idTipoRelacionamento;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SocioDependente)) {
            return false;
        }
        SocioDependente other = (SocioDependente) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.SocioDependente[ id=" + id + " ]";
    }
    
}
